<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html lang="zh">
<head>
    <title>系统角色</title>
    <jsp:include page="/WEB-INF/view/commons/css.jsp" />
</head>
<body >
<div id="main-container" class="container-fluid">
    <form  action="sysuser/changePassword" name="inputForm" id="inputForm" method="post" class="form-horizontal">
        <div class="form-group">
            <label class="col-sm-1 control-label">原密码：</label>
            <div class="col-md-4">
                <input type="password" class="form-control" name="password" />
            </div>
           
        </div>

        <div class="form-group">
            <label class="col-sm-1 control-label">新密码：</label>
            <div class="col-md-4">
                <input type="password" class="form-control" name="newPass" />
            </div>
            
        </div>
        <div class="form-group">
            <label class="col-sm-1 control-label">确认密码：</label>
            <div class="col-md-4">
                <input type="password" class="form-control" name="newPassConfirm" />
            </div>
        </div>

        <div class="form-group">
            <div class="col-sm-offset-1 col-sm-2">
                <button id="saveBtn" type="submit" class="btn btn-sm btn-primary"><i class="fa fa-floppy-o"></i> 确定</button>
                <button type="button" class="btn btn-sm link_close"><i class="fa fa-close"></i> 取消</button>
            </div>
        </div>
    </form>
</div><!--/#main-container-->

<!-- script start -->
<jsp:include page="/WEB-INF/view/commons/js.jsp" />
<script type="text/javascript">
    $(document).ready(function(e) {
        var options = {
            rules:{
            	password:{required:true,maxlength : 50},
            	newPass:{required:true,maxlength : 50},
            	newPassConfirm:{required:true,maxlength : 50}
            },
            submitHandler:function(form){
                $(form).ajaxSubmit({
                    type:'post',
                    dataType:'json',
                    success:function(data){
                        if(data.success){
                            layer.alert("修改密码成功",function(){
                            	closeIframe();
                            });
                        }else{
                            layer.alert(data.msg);
                        }
                    }
                }); 
            }
        };
        $("#inputForm").validate(options);
    });
</script>
<!-- script end -->
</body>
</html>
